WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
wolf::LandmarkBase Class Reference

#include <core/landmark/landmark_base.h>

Inheritance diagram for wolf::LandmarkBase:
[legend]

Public Member Functions

 LandmarkBase (const std::string &_type, const TypeComposite &_state_types, const VectorComposite &_state_vectors, const PriorComposite &_state_priors, const int _external_id=-1, const int _external_type=-1)
 Constructor type and state specs composites (types, vectors, priors) More...
 
 LandmarkBase (const std::string &_type, const TypeComposite &_state_types, const YAML::Node &_n)
 Constructor with type, state types composite and a YAML node (to be used by the derived classes YAML node constructors) More...
 
 ~LandmarkBase () override=default
 
void remove (bool viral_remove_parent_without_children=false) override
 
YAML::Node toYaml () const override
 
unsigned int id () const override
 
void setId (unsigned int _id)
 
unsigned int trackId ()
 
void setTrackId (unsigned int _track_id)
 
void setExternalId (const int &_external_id)
 
int getExternalId () const
 
void setExternalType (const int &_external_type)
 
int getExternalType () const
 
MapBaseConstPtr getMap () const
 
MapBasePtr getMap ()
 
void link (MapBasePtr)
 
virtual void printHeader (int depth, bool factored_by, bool metric, bool state_blocks, std::ostream &stream, std::string _tabs="") const
 
virtual void print (int depth, bool factored_by, bool metric, bool state_blocks, std::ostream &stream=std::cout, std::string _tabs="") const
 
virtual CheckLog localCheck (bool _verbose, std::ostream &_stream, std::string _tabs="") const
 
virtual bool check (CheckLog &_log, bool _verbose, std::ostream &_stream, std::string _tabs="") const
 
LandmarkBasePtr shared_from_this_landmark ()
 
LandmarkBaseConstPtr shared_from_this_landmark () const
 
- Public Member Functions inherited from wolf::NodeStateBlocks
 NodeStateBlocks (const std::string &_category, const std::string &_type, const TypeComposite &_state_types, const VectorComposite &_state_vectors, const PriorComposite &_state_priors)
 Constructor. More...
 
virtual ~NodeStateBlocks ()
 
virtual YAML::Node toYaml () const
 
StateKeys getKeys () const
 
TypeComposite getStateTypes () const
 
bool has (const char &_sb_key) const
 
bool has (const std::string &_keys) const
 
virtual unsigned int id () const =0
 
std::map< char, StateBlockConstPtr > getStateBlockMap () const
 
std::map< char, StateBlockPtr > getStateBlockMap ()
 
std::vector< StateBlockConstPtr > getStateBlockVec () const
 
std::vector< StateBlockPtr > getStateBlockVec ()
 
StateBlockConstPtr getP () const
 
StateBlockConstPtr getO () const
 
StateBlockPtr getP ()
 
StateBlockPtr getO ()
 
virtual void fix ()
 
virtual void unfix ()
 
virtual bool isFixed () const
 
StateBlockPtr emplaceStateBlock (const char key, const std::string &_type, const Eigen::VectorXd &_vector, const bool &_fixed)
 Emplace a state block. More...
 
StateBlockPtr emplaceStateBlockZero (const char key, const std::string &_type, const bool &_fixed)
 Emplace a state block with zero state. More...
 
bool hasStateBlock (const StateBlockConstPtr &_sb) const
 
bool setStateBlock (const char _sb_key, const StateBlockPtr &_sb)
 
bool stateBlockKey (const StateBlockConstPtr &_sb, char &_key) const
 
virtual StateBlockConstPtr getStateBlock (const char &_sb_key) const
 
virtual StateBlockPtr getStateBlock (const char &_sb_key)
 
void setProblem (ProblemPtr _problem) override
 
virtual void remove (bool viral_remove_parent_without_children=false)
 
bool hasChildren () const override
 
void emplaceFactorStateBlock (const char &_key, const Eigen::VectorXd &_x, const Eigen::MatrixXd &_cov, unsigned int _start_idx=0)
 Add an absolute factor to a parameter. More...
 
void emplacePriors ()
 
FactorBaseConstPtrSet getFactoredBySet () const
 
FactorBasePtrSet getFactoredBySet ()
 
void getFactoredBySet (FactorBaseConstPtrSet &_fac_set) const
 
void getFactoredBySet (FactorBasePtrSet &_fac_set)
 
FactorBaseConstPtrSet getSensoryFactorSet () const
 
FactorBasePtrSet getSensoryFactorSet ()
 
std::map< char, FactorBaseConstPtr > getPriorFactorMap () const
 
std::map< char, FactorBasePtr > getPriorFactorMap ()
 
FactorBaseConstPtr getPriorFactor (char) const
 
FactorBasePtr getPriorFactor (char)
 
FactorBaseConstPtrList getFactorsOf (ProcessorBaseConstPtr _processor_ptr, const std::string &type="") const
 
FactorBasePtrList getFactorsOf (ProcessorBasePtr _processor_ptr, const std::string &type="")
 
bool hasFactor (FactorBaseConstPtr _fac) const
 
VectorComposite getState (const StateKeys &_keys="") const
 
void setState (const VectorComposite &_state, const bool _notify=true)
 
void setState (const Eigen::VectorXd &_state, const StateKeys &_keys, const std::list< SizeEigen > &_sizes, const bool _notify=true)
 
void setState (const Eigen::VectorXd &_state, const StateKeys &_keys, const bool _notify=true)
 
void setState (const StateKeys &_keys, const std::list< Eigen::VectorXd > &_vectors, const bool _notify=true)
 
Eigen::VectorXd getStateVector (const StateKeys &_keys) const
 
unsigned int getSize (const StateKeys &_keys="") const
 
unsigned int getLocalSize (const StateKeys &_keys="") const
 
bool getCovariance (const StateKeys &_keys, Eigen::MatrixXd &_cov) const
 
void perturb (double amplitude=0.01)
 perturb all states states with random noise following an uniform distribution in [ -amplitude, amplitude ] More...
 
bool isCapture () const
 
bool isFrame () const
 
bool isLandmark () const
 
bool isSensor () const
 
- Public Member Functions inherited from wolf::NodeBase
 NodeBase (const std::string &_category, const std::string &_type="Undefined", const std::string &_name="")
 
virtual ~NodeBase ()=default
 
unsigned int nodeId () const
 
std::string getCategory () const
 
std::string getType () const
 
std::string getName () const
 
bool isRemoving () const
 
virtual bool hasChildren () const =0
 
void setType (const std::string &_type)
 
void setName (const std::string &_name)
 
ProblemConstPtr getProblem () const
 
ProblemPtr getProblem ()
 

Static Public Member Functions

template<typename classType , typename... T>
static std::shared_ptr< classType > emplace (MapBasePtr _map_ptr, T &&... all)
 

Protected Member Functions

void setProblem (ProblemPtr _problem) override
 
- Protected Member Functions inherited from wolf::NodeStateBlocks
virtual void removeStateBlock (const char &_sb_key)
 
void transform (const VectorComposite &_transformation)
 
void printState (bool _factored_by, bool _metric, bool _state_blocks, std::ostream &_stream, std::string _tabs) const
 
CheckLog localCheck (bool _verbose, std::ostream &_stream, std::string _tabs) const
 
virtual void setProblem (ProblemPtr _prob_ptr)
 

Protected Attributes

unsigned int landmark_id_
 landmark unique id More...
 
unsigned int track_id_
 associated track id More...
 
int external_id_
 Id provided by an external tracker (-1 untracked) More...
 
int external_type_
 Type provided by an external classifier (-1 unclassified) More...
 
TimeStamp stamp_
 stamp of the creation of the landmark More...
 
- Protected Attributes inherited from wolf::NodeBase
ProblemWPtr problem_ptr_
 
unsigned int node_id_
 Node id. It is unique over the whole Wolf Tree. More...
 
std::string node_category_
 Text label identifying the category of node ("SENSOR", "FEATURE", etc) More...
 
std::string node_type_
 Text label identifying the type or subcategory of node ("Pin Hole", "Point 2d", etc) More...
 
std::string node_name_
 
bool is_removing_
 A flag for safely removing nodes from the Wolf tree. See remove(). More...
 

Constructor & Destructor Documentation

◆ LandmarkBase() [1/2]

wolf::LandmarkBase::LandmarkBase ( const std::string &  _type,
const TypeComposite &  _state_types,
const VectorComposite &  _state_vectors,
const PriorComposite &  _state_priors,
const int  _external_id = -1,
const int  _external_type = -1 
)

Constructor type and state specs composites (types, vectors, priors)

Constructor with type and specs composite

Parameters
_typeTO BE HARDCODED IN THE DERIVED CLASS CONSTRUCTOR: derived landmark class name
_state_typesTO BE HARDCODED IN THE DERIVED CLASS CONSTRUCTOR: Composite of types of the landmark states.
_state_vectorsComposite of vectors of the states of the node. A 'StateBlock' for each key in '_state_vectors' will be emplaced (of the type specified in '_state_types'). Not all keys of '_state_types' are required to be specified, but all keys of '_state_vectors' should be in '_state_types'.
_state_priorsComposite of priors (initial_guess, factor or fixed) of the states of the node. Not all keys of '_state_vectors' are required to be specified, but all keys of '_state_priors' should be in '_state_vectors'. If not specified, no prior is assumed, i.e. 'initial_guess'.
_external_idID provided by an external tracker (default: -1 untracked)
_external_typeTYPE provided by an external classifier (default: -1 unclassified)

◆ LandmarkBase() [2/2]

wolf::LandmarkBase::LandmarkBase ( const std::string &  _type,
const TypeComposite &  _state_types,
const YAML::Node &  _n 
)

Constructor with type, state types composite and a YAML node (to be used by the derived classes YAML node constructors)

Constructor with type, and YAML node

Parameters
_typeTO BE HARDCODED IN THE DERIVED CLASS CONSTRUCTOR: derived landmark class name
_state_typesTO BE HARDCODED IN THE DERIVED CLASS CONSTRUCTOR: Composite of types of the landmark states.
_nYAML node containing the necessary information

◆ ~LandmarkBase()

wolf::LandmarkBase::~LandmarkBase ( )
overridedefault

Member Function Documentation

◆ check()

bool wolf::LandmarkBase::check ( CheckLog &  _log,
bool  _verbose,
std::ostream &  _stream,
std::string  _tabs = "" 
) const
virtual

◆ emplace()

template<typename classType , typename... T>
std::shared_ptr< classType > wolf::LandmarkBase::emplace ( MapBasePtr  _map_ptr,
T &&...  all 
)
static

◆ getExternalId()

int wolf::LandmarkBase::getExternalId ( ) const
inline

◆ getExternalType()

int wolf::LandmarkBase::getExternalType ( ) const
inline

◆ getMap() [1/2]

MapBasePtr wolf::LandmarkBase::getMap ( )
inline

◆ getMap() [2/2]

MapBaseConstPtr wolf::LandmarkBase::getMap ( ) const
inline

◆ id()

unsigned int wolf::LandmarkBase::id ( ) const
inlineoverridevirtual

Implements wolf::NodeStateBlocks.

◆ link()

void wolf::LandmarkBase::link ( MapBasePtr  _map_ptr)

◆ localCheck()

CheckLog wolf::LandmarkBase::localCheck ( bool  _verbose,
std::ostream &  _stream,
std::string  _tabs = "" 
) const
virtual

◆ print()

void wolf::LandmarkBase::print ( int  depth,
bool  factored_by,
bool  metric,
bool  state_blocks,
std::ostream &  stream = std::cout,
std::string  _tabs = "" 
) const
virtual

◆ printHeader()

void wolf::LandmarkBase::printHeader ( int  depth,
bool  factored_by,
bool  metric,
bool  state_blocks,
std::ostream &  stream,
std::string  _tabs = "" 
) const
virtual

◆ remove()

void wolf::LandmarkBase::remove ( bool  viral_remove_parent_without_children = false)
overridevirtual

Reimplemented from wolf::NodeStateBlocks.

◆ setExternalId()

void wolf::LandmarkBase::setExternalId ( const int &  _external_id)
inline

◆ setExternalType()

void wolf::LandmarkBase::setExternalType ( const int &  _external_type)
inline

◆ setId()

void wolf::LandmarkBase::setId ( unsigned int  _id)
inline

◆ setProblem()

void wolf::LandmarkBase::setProblem ( ProblemPtr  _problem)
overrideprotectedvirtual

Reimplemented from wolf::NodeStateBlocks.

◆ setTrackId()

void wolf::LandmarkBase::setTrackId ( unsigned int  _track_id)
inline

◆ shared_from_this_landmark() [1/2]

LandmarkBasePtr wolf::LandmarkBase::shared_from_this_landmark ( )
inline

◆ shared_from_this_landmark() [2/2]

LandmarkBaseConstPtr wolf::LandmarkBase::shared_from_this_landmark ( ) const
inline

◆ toYaml()

YAML::Node wolf::LandmarkBase::toYaml ( ) const
overridevirtual

Reimplemented from wolf::NodeStateBlocks.

◆ trackId()

unsigned int wolf::LandmarkBase::trackId ( )
inline

Member Data Documentation

◆ external_id_

int wolf::LandmarkBase::external_id_
protected

Id provided by an external tracker (-1 untracked)

◆ external_type_

int wolf::LandmarkBase::external_type_
protected

Type provided by an external classifier (-1 unclassified)

◆ landmark_id_

unsigned int wolf::LandmarkBase::landmark_id_
protected

landmark unique id

◆ stamp_

TimeStamp wolf::LandmarkBase::stamp_
protected

stamp of the creation of the landmark

◆ track_id_

unsigned int wolf::LandmarkBase::track_id_
protected

associated track id


The documentation for this class was generated from the following files: